package propriedades;

import java.util.ArrayList;

import com.example.primeiraaplicacao.R;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

public class ExemploSpiner extends Activity {
	private ArrayList<String> planetas=new ArrayList<String>();
	public void onCreate(Bundle icicle){
		super.onCreate(icicle);
		setContentView(R.layout.exemplo_spiner);
		Spinner sp = (Spinner)findViewById(R.id.comboPlanetas);
		planetas.add("-----Selecione-----");
		planetas.add("Mercurio");
		planetas.add("Venus");
		planetas.add("Terra");
		planetas.add("Marte");
		ArrayAdapter<String> adaptador=new ArrayAdapter<String>(this, 
				android.R.layout.simple_spinner_item, planetas);
		adaptador.setDropDownViewResource(android.R.layout.simple_spinner_item);
		sp.setAdapter(adaptador);
	}
}
